package com.bzzoneit.newsys.service.admin;

import com.bzzoneit.newsys.entity.admin.SchedulerJob;
import com.bzzoneit.newsys.utils.page.Page;

public interface SchedulerService {
	void insertScheduler(SchedulerJob  scheduler);
	void updateScheduler(SchedulerJob  scheduler);
	void deleteScheduler(long id);
	SchedulerJob selectScheduler(long id);
	Page<SchedulerJob> getSchedulerList(Page<SchedulerJob> page);

	/**
	 * 功能说明：根据任务名称查询任务是否存在
	 * @author jacobliang
	 * @param jobName		任务名称
	 * @return
	 * @time Jan 12, 2011 10:56:51 AM
	 */
	public boolean findSysplSchedulerJobByJobName(String jobName);
	/**
	 * 功能说明：启动调度器
	 * @author jacobliang
	 * @time Jan 18, 2011 4:14:37 PM
	 */
	public void startScheduler() throws Exception;
	/**
	 * 功能说明：停止调度器
	 * @author jacobliang
	 * @time Jan 18, 2011 4:15:32 PM
	 */
	public void stopScheduler() throws Exception;
	/**
	 * 功能说明：启动job
	 * @author jacobliang
	 * @param	jobId				任务ID
	 * @time Jan 18, 2011 4:20:22 PM
	 */
	public void startJob(long jobId) throws Exception;
	/**
	 * 功能说明：停止job
	 * @author jacobliang
	 * @param	jobId				任务ID
	 * @param 	jobName				任务名称
	 * @return
	 * @time Jan 18, 2011 4:29:32 PM
	 */
	public void stopJob(long jobId,String jobName) throws Exception;
}
